﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SystemMHB.Infrstructer
{
    /// <summary>
    /// 总仓储接口
    /// </summary>
    public interface IRepository<T> where T : class,new()
    {

        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>返回数据信息</returns>
        Task<T> GetModelAsync(int id);
        /// <summary>
        /// 显示全部数据信息
        /// </summary>
        /// <returns>返回数据信息集合</returns>
        Task<List<T>> GetAllAsync();

        /// <summary>
        /// 添加数据信息
        /// </summary>
        /// <param name="expre">要添加的数据信息</param>
        /// <returns>返回受影响行数</returns>
        Task<int> AddAsync(T expre);
        /// <summary>
        /// 修改数据信息（逻辑删除）可以批量删除
        /// </summary>
        /// <param name="expre">修改后的数据信息</param>
        /// <returns>返回受影响行数</returns>
        Task<int> UpdateAsync(T expre);
    }
}
